package com.demo.ribbon;

import com.demo.config.RibbonConfiguration;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.netflix.ribbon.RibbonClient;
import org.springframework.cloud.netflix.ribbon.RibbonClients;

@EnableDiscoveryClient
@SpringBootApplication(scanBasePackages = {"com.demo.ribbon"})   // 定义扫描包
// 这里可以给不同服务设置不同的 ribbon策略
@RibbonClients({
        @RibbonClient(name = "server-provider",configuration = RibbonConfiguration.class),  // 自定义 ribbon策略
})
public class RibbonApplication {

    public static void main(String[] args) {
        SpringApplication.run(RibbonApplication.class, args);
    }

}
